package com.likou;

/**
 * Author: 陈桂明
 * Date: 2025/9/3 9:38
 * Description: q55
 */
public class q55 {

    public boolean canJump(int[] nums) {
        int max = 0;
        for (int i = 0; i < nums.length; i++) {
            if (i <= max) {
                max = Math.max(max, i + nums[i]);

                if (max >= nums.length - 1) {
                    return true;
                }
            }
        }

        return false;
    }
}
